import com.adobe.cairngorm.control.CairngormEventDispatcher;

import flash.events.Event;

import mx.events.ListEvent;

import net.optix.ip.events.GetBidTradeMarksEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.TradeMarkVO;

import views.ViewInstance;

[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

[Bindable]
private var mark:TradeMarkVO;

private function initApp():void
{
	var getBids:GetBidTradeMarksEvent	=	new GetBidTradeMarksEvent(model.firm.firmID);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(getBids);	
}

private function selectMark(event:Event):void
{
	if(event.type == ListEvent.ITEM_DOUBLE_CLICK)
	{
		mark	=	TradeMarkVO(event.target.selectedItem);	
		model.oldView	=	ViewInstance.ViewTradeMarkBids;
		model.view	=	0;
		model.view	=	ViewInstance.ViewTradeMark;
		model.currentTradeMark	=	mark;
	}
	else
	{
		mark	=	TradeMarkVO(event.target.selectedItem);	
		intShow	=	0;
	}
}

[Bindable]
private var intShow:int	=	-1;

private function showRecord():void
{
	intShow	=	1;
}

private function back():void
{
	intShow	=	0;
}